<template>
	<view>
		<view>
			<img style="width: 100%;height: 200px;"
				src="https://www.ichose360.com/uploads/10001/20231122/f20dd4a9ba52949e0672be44262c3c6b.jpg" />
		</view>

		<view style="padding: 15px;">

			<view style="margin-top: 15px;display: flex;justify-content: center;">
				<view style="margin-right: 5px;font-weight: bold;">环境卫生</view>
				<u-rate :count="counthj" v-model="valuehj" size="60" gutter="20"></u-rate>
			</view>
		</view>

		<view style="padding: 15px;">
			<view style="display: flex;justify-content: center;">
				<view style="margin-right: 5px;font-weight: bold;">器械消毒</view>
				<u-rate :count="countxd" v-model="valuexd" size="60" gutter="20"></u-rate>
			</view>
		</view>

		<view style="padding: 15px;">
			<view style="display: flex;justify-content: center;">
				<view style="margin-right: 5px;font-weight: bold;">诊疗质量</view>
				<u-rate :count="countzl" v-model="valuezl" size="60" gutter="20"></u-rate>
			</view>
		</view>

		<view style="padding: 15px;">
			<view style="display: flex;justify-content: center;">
				<view style="margin-right: 5px;font-weight: bold;">患者沟通</view>
				<u-rate :count="countgt" v-model="valuegt" size="60" gutter="20"></u-rate>
			</view>
		</view>

		<view style="padding: 15px;">
			<view style="display: flex;justify-content: center;">
				<view style="margin-right: 5px;font-weight: bold;">服务态度</view>
				<u-rate :count="counttd" v-model="valuetd" size="60" gutter="20"></u-rate>
			</view>
		</view>

		<view style="padding: 15px;">
			<view style="display: flex;justify-content: center;">
				<view style="margin-right: 5px;font-weight: bold;">价格透明</view>
				<u-rate :count="counttm" v-model="valuetm" size="60" gutter="20"></u-rate>
			</view>
		</view>


		<view style="padding: 15px;">
			<view style="display: flex;justify-content: center;">
				<view style="margin-right: 5px;font-weight: bold;">整体感受</view>
				<u-rate :count="countzt" v-model="valuezt" size="60" gutter="20"></u-rate>
			</view>
		</view>

		<view style="padding: 15px;">
			<view style="display: flex;justify-content: center;">
				<view style="margin-right: 5px;font-weight: bold;">等候时间</view>
				<u-rate :count="countdh" v-model="valuedh" size="60" gutter="20"></u-rate>
			</view>
		</view>

		<view style="padding: 15px;">
			<u-button type="primary" style="30%" @click="addSatisfy">确定</u-button>
		</view>

		<u-modal v-model="modelShow" :content="modalContent"></u-modal>

</template>

<script>
	import store from '@/store'
	import * as UserApi from '@/api/user'
	import * as SatisfyApi from '@/api/satisfy/index'
	import {
		checkLogin
	} from '@/core/app'
	export default {
		data() {
			return {
				modelShow: false,
				counthj: 3,
				valuehj: 0,
				countxd: 3,
				valuexd: 0,
				countzl: 3,
				valuezl: 0,
				countgt: 3,
				valuegt: 0,
				counttd: 3,
				valuetd: 0,
				counttm: 3,
				valuetm: 0,
				countzt: 3,
				valuezt: 0,
				countdh: 3,
				valuedh: 0,

			}
		},

		methods: {

			phonecall() {
				wx.makePhoneCall({
					phoneNumber: '1340000' //仅为示例，并非真实的电话号码
				})
			},
			addSatisfy() {
				var statisfyData = {
					"ws": this.valuehj,
					"xd": this.valuexd,
					"zl": this.valuezl,
					"gt": this.valuegt,
					"td": this.valuetd,
					"tm": this.valuetm,
					"zt": this.valuezt,
					"dh": this.valuedh
				}
				console.log(statisfyData)
				SatisfyApi.add(statisfyData)
					.then(result => {
						openModal(result.message);
						// this.$toast(result.message)
						uni.navigateBack()
					})
					.finally(() => console.log(1))
			},
			
			openModal(mesg) {
				this.modelShow = true;
				this.modalContent = mesg;
			},


		}
	}
</script>

<style lang="scss" scoped>

</style>